-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use LUT for linear to sRGB conversion #18
Conversation
Oh, I didn't see that there were more tests. |
This test fails even on main on my machine:
|
That might not be an issue; that test has failed randomly anyway. Can you maybe check the visuals for decoding? |
Cross-checked with #14, doesn't fail. |
Would this be a case for https://docs.rs/phf/latest/phf/ ? 🤔 |
@thvdveld a rebase on main should make the tests pass with a higher probability ;-) |
Using a LUT for the linear to sRGB conversion improves decoding performance for the decode_into benchmark: ``` decode_into LGF5]+Yk^6#M@-5c,1J5@[or[Q6./200 time: [766.58 µs 769.86 µs 776.05 µs] change: [-62.967% -62.784% -62.602%] (p = 0.00 < 0.05) Performance has improved. ``` However, the size of the LUT is 8.192 u8. The `fast-linear-to-srgb` feature flag was added, which is enabled by default. In cases where binary size is more important than performance, the feature can be disabled. Another note in the implementation: using a lookup table reduces the accuracy of the conversion, compared to the original implementation. But all current tests pass. Higher accuracy can be achieved by increasing the LUT size.
All checks have passed! 🎉 |
On my armv7 phone:
That's 10ms faster :'-) |
Using a LUT for the linear to sRGB conversion improves decoding performance for the decode_into benchmark:
However, the size of the LUT is 8.192 u8. The
fast-linear-to-srgb
feature flag was added, which is enabled by default. In cases where binary size is more important than performance, the feature can be disabled.Another note in the implementation: using a lookup table reduces the accuracy of the conversion, compared to the original implementation. But all current tests pass. Higher accuracy can be achieved by increasing the LUT size.